package com.bitdf.txing.users.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bitdf.txing.users.dao.UserReceiveAddressDao;
import com.bitdf.txing.users.entity.UserReceiveAddressEntity;
import com.bitdf.txing.users.service.UserReceiveAddressService;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("UserReceiveAddressService")
public class UserReceiveAddressServiceImpl extends ServiceImpl<UserReceiveAddressDao, UserReceiveAddressEntity> implements UserReceiveAddressService {

//    @Override
//    public PageUtils queryPage(Map<String, Object> params) {
//        IPage<UserReceiveAddressEntity> page = this.page(
//                new Query<UserReceiveAddressEntity>().getPage(params),
//                new QueryWrapper<UserReceiveAddressEntity>()
//        );
//
//        return new PageUtils(page);
//    }

    /**
     * 获取收货地址
     * @param userId
     * @return
     */
    @Override
    public List<UserReceiveAddressEntity> getAddress(Long userId) {
        return this.list(new QueryWrapper<UserReceiveAddressEntity>().eq("user_id", userId));
    }

}